﻿Imports QLTHUVIEN.DTO
Public Class NhaXuatBanDAO

    Public Function LayDanhSach() As DataTable
        Dim strSql As String = "SELECT MaNhaXuatBan, TenNhaXuatBan FROM NHAXUATBAN WHERE isDelete = 'False'"
        Dim dt As DataTable = DataProvider.ExecuteQuery(strSql)
        Return dt
    End Function

    Public Sub ThemNhaXuatBan(ByVal NhaXuatBan As NhaXuatBanDTO)
        Dim strSql As String = "INSERT INTO NHAXUATBAN(TenNhaXuatBan) VALUES(N'" & NhaXuatBan.TenNhaXuatBan & "')"
        DataProvider.ExecuteQuery(strSql)
    End Sub

    Public Sub SuaNhaXuatBan(ByVal NhaXuatBan As NhaXuatBanDTO)
        Dim strSql As String = "UPDATE NHAXUATBAN SET TenNhaXuatBan =N'" & NhaXuatBan.TenNhaXuatBan & "' WHERE MaNhaXuatBan = " & NhaXuatBan.MaNhaXuatBan
        DataProvider.ExecuteQuery(strSql)
    End Sub

    Public Sub XoaNhaXuatBan(ByVal NhaXuatBan As NhaXuatBanDTO)
        Dim strSql As String = "UPDATE NHAXUATBAN SET isDelete ='" & NhaXuatBan.IsDelete.ToString() & "' WHERE MaNhaXuatBan = " & NhaXuatBan.MaNhaXuatBan
        DataProvider.ExecuteQuery(strSql)
    End Sub

End Class
